import {SearchValue} from '../../Axios'
import { Component } from 'react';
import { Input } from 'antd';
const { Search } = Input;
class DrugAllHeader extends Component {
    constructor(props) {
        super(props);
        this.state = { 
            SearchData:[]
         }
    }
    testData=[{
            key:"999感冒灵",
            drugId: '1',
            name: '999感冒灵',
            inventory: 32,
            price: '813元',
            type: '西药',
          },
          {
              drugId: '2',
              name: '黄芪',
              inventory: 732,
              price: '7298元',
              type: '中药',
              key:"黄芪",
          },
          {
              drugId: '3',
              name: '人参',
              inventory: 98,
              price: '484元',
              type: '中药',
              key:"人参",
          }]
    async onSearch(value,e){
        let data = await SearchValue({value});
        this.setState({ data });
    }
    render() { 
        return (
            <div><Search
            placeholder="input search text"
            enterButton="Search"
            size="large"
            onSearch={(value,e)=>this.onSearch(value,e)}
          /></div>
        );
    }
}
 
export default DrugAllHeader;